Skip to content

BUG: Unable to pass additional arguments to resample().apply() #14635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sivieri
Copy link

@sivieri sivieri commented Nov 10, 2016

# otherwise the first element of args is "eaten" by grouper in
# _groupby_and_aggregate.
if len(args) == 0:
return self._groupby_and_aggregate(arg,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you need to figure out the reason and not put in hacks
if u can't then can simply construct the args (you make a tuple) and pass to the function
but would like to see where it's not getting passed thru

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I disappeared for a long time!
Yes, I know it was a hack and I agree it's not a real solution... but I don't know the internals of the code, so I'm not sure I can figure this out...

The problem in my opinion is the definition of the function itself: it seems like you cannot have a function with a named argument with a default value, immediately followed by a variadic part, because the interpreter has no idea where to put the first argument (in the named one or as the first parameter of the variadic?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that *args can be removed from _groupby_and_aggregate. this should solve the issue I think. IOW, you can only pass kwargs except for named args. The grouper arg is really internally anyhow.

@jreback jreback changed the title Patching issue number 14615 BUG: Unable to pass additional arguments to resample().apply() Nov 11, 2016
@jreback
Copy link
Contributor

jreback commented Dec 16, 2016

can you rebase / update

1 similar comment
@jreback
Copy link
Contributor

jreback commented Dec 30, 2016

can you rebase / update

@jreback
Copy link
Contributor

jreback commented Feb 27, 2017

closing as stale. please ping if you'd like to continue.

@jreback jreback closed this Feb 27, 2017
@jreback jreback added this to the No action milestone Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to pass additional arguments to resample().apply()
2 participants